<?php
defined('_JEXEC') or die('Restricted access');
global $mainframe;
$document =& JFactory::getDocument();
//jimport('joomla.html.pane');
$editor = & JFactory :: getEditor();

$document->addStyleSheet('components/com_wrecruit/css/other_employers.css');
$document->addScript ('components/com_wrecruit/js/other_employers.js');
$document->addScript( 'components/com_wrecruit/js/emppopup.js' );
$document->addStyleSheet('components/com_wrecruit/css/emppopup.css');
$model = $this->getModel('wrecruit', 'WRecruitModel');
?>
<style type="text/css">

</style>
<script language="Javascript">

</script>

<?php if ($this->config['offline'] == '1'){ ?>
<table cellpadding="0" cellspacing="0" border="0" width="100%">
	<tr>
		<td valign="top" class="<?php echo $this->theme['title']; ?>"><?php echo $this->config['title']; ?>
		</td>
	</tr>
	<tr>
		<td height="25"></td>
	</tr>
	<tr>
		<td class="wrecruitmsg"><?php echo $this->config['offline_text']; ?>
		</td>
	</tr>
</table>
<?php }
else{
	if (isset($this->userrole->rolefor)){
		if ($this->userrole->rolefor == 1) // employer
		$allowed = true;
		else
		$allowed = false;
	}
	else { if ($this->config['visitorview_emp_conrolpanel'] == 1) $allowed = true; else $allowed = false; } // user not logined
	if ($allowed == true) {
		?>
<div class="box-list-job">
	<div class="job-seeker-panel">
	<?php include 'left_panel.php';?>
	</div>
	<div class="job-seeker-right">
		<div class="head-title">
		<h2>Your account and company profile</h2>
		</div>
		<?php foreach ($this->information as $item){?>
		<!--sreynuon add content-->
         <form id="form-employer" method="post" action="">
          <!--start 1-->
		<div class="employer">
            <h3 class="sub-title">Contact info</h3>
		    <div class="divwrapp">
				<p><label class="txt-e">Contact name: <span class="star">*</span></label>
					<input type="text" class="input-text" value="<?php echo $item->contactname;?>" alt="" name="contact-name" placeholder="Contact name..." />
                            </p>
                                <p><label class="txt-e">Contact Phone: <span class="star"></span></label>
					<input type="text" class="input-text" value="<?php echo $item->contactphone;?>" alt="" name="contact-phone" placeholder="Contact Phone..." />
                            </p>
                                <p><label class="txt-e">Contact E-mail: <span class="star">*</span></label>
					<input type="text" class="input-text" value="<?php echo $item->email;?>" alt="" name="contact-phone" placeholder="Contact E-mail..." />
                            </p>
                                 <p><label class="txt-e">Contact Title: <span class="star">*</span></label>
					<select name="contact-title" class="dropdown-box" id="contact-title">
                                  <option value="<?php echo $item->title;?>"><?php echo $item->title;?></option>
                            </select>
                            </p>
                            <p><label class="txt-e">Contact position: <span class="star"></span></label>
								<input type="text" class="input-text e-input" id="contact-position" value="<?php echo $item->position;?>" alt="" name="contact-phone" placeholder="Contact position..." />
                            </p>
			</div>
		</div><!--end start 1-->
                        
                        <!--start 2-->
		<div class="employer">
                           <h3 class="sub-title">Company info</h3>
		    <div class="divwrapp">
				<p><label class="txt-e">Company name: <span class="star">*</span></label>
					<input type="text" class="input-text" value="<?php echo $item->companyname;?>" alt="" name="company-name" placeholder="Company name..." />
                            </p>
                                <p><label class="txt-e">Category/industry: <span class="star">*</span></label>
                                    <select name="company-industy" class="dropdown-box" id="company-industy">
                                       <option value="<?php echo $item->category;?>"><?php echo $item->cat_title;?></option>
                            </select>
                            </p>
                                <p><label class="txt-e">Created date: <span class="star"></span></label>
					<input type="text" class="input-text, e-input" value="<?php echo $item->created;?>" alt="" name="contact-phone" placeholder="Contact E-mail..." />
                            </p>
                                 <p><label class="txt-e">Company income: <span class="star"></span></label>
					<select name="contact-title" class="dropdown-box" id="contact-title">
                                       <option value="<?php echo $item->income;?>"><?php echo $item->income;?></option> 
                            </select>
                            </p>
                             <p><label class="txt-e">Company logo: <span class="star"></span></label>
                             <img style="width:200px; height: 200px;" src="/wrecruitdata/data/employer/comp_<?php echo $item->compid;?>/logo/<?php echo $item->logofilename;?>" alt="<?php echo $item->logofilename;?>" />
			                <span id="small-txt" style=" float:left;font-size:10px; color:#888; margin-left:125px;">Max width: 200px, Min file size: 50KB</span>
                            </p>
                            <br/>
                            <p>
                            <?php echo $editor->display('description',$item->description, '475', '100','60','20', false);?>
                                <span class="star">*</span>
                            </p>
                                <p><label class="txt-e">Company website: <span class="star"></span></label>
					<input type="text" class="input-text" value="<?php echo $item->website;?>" alt="" name="contact-name" placeholder="Company website..." />
                            </p>
                                <p><label class="txt-e">Company E-mail: <span class="star"></span></label>
					<input type="text" class="input-text" value="<?php echo $item->companyemail;?>" alt="" name="contact-phone" placeholder="Company E-mail..." />
                            </p>
                                 <p><label class="txt-e">Contry: <span class="star">*</span></label>
					<select name="contact-title" class="dropdown-box" id="contact-title">
                                       <option value=""><?php echo $item->country;?></option>
                            </select>
                            </p>
                                 <p><label class="txt-e">City: <span class="star"></span></label>
					<input type="text" class="input-text e-input" id="contact-position" value="<?php echo $item->city;?>" alt="" name="contact-phone" placeholder="City..." />
                            </p>
                                <p><label class="txt-e">Company address: <span class="star">*</span></label>
					<input type="text" class="input-text" value="<?php echo $item->address1;?>" alt="" name="contact-phone" placeholder="Company address..." />
                            </p>
                            <br/>    
                            <p>
                                <?php echo $editor->display('map', '', '475', '100','60','20', false);?>
                           		<span class="star">*</span>
                            </p>
                                
			</div>
		</div><!--end start 2-->
                        
                        <!--start 3-->
                        <div class="employer">
                           <h3 class="sub-title" id="e-last">Account info</h3>
                        </div>
                        <div style="float:left;margin-top:30px;"><strong>You logged in with this E-mail address:</strong>&nbsp;&nbsp;<?php echo $item->email;?></div>
                        <div class="divwrapp-e">
                         <table border="0" width="100%" class="account-info" >
                            <tbody>
                                <tr><td colspan="2">&nbsp;</td></tr>
                                <tr>
                                    <td class="candidate-text"></td>
                                    <td class="float-right"><span style="text-decoration:underline; cursor:pointer; text-align:right; float:right; color:#888;" class="wpopup" id="email">Change your email address?</span></td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td class="float-right" style="text-align:right; text-decoration:underline; color:#888;"><a href="#" style="color:#888;" class="wpopup" id="password">Change your password?</a></td>
                                </tr>
                                <tr>
                                    <td><strong>Your account:</strong> <span id="candidate-tex" >candidate's acouunt package</span></td>
                                    <td class="float-right" style="text-align:right; text-decoration:underline; color:#888;"><a href="#" style="color:#888;">Upgrade your account?</a></td>
                                </tr>
                                <tr>
                                    <td>&nbsp;</td>
                                    <td class="float-right" style="text-align:right; text-decoration:underline; color:#888;"><a href="#" style="color:#888;">Learn more about account packages and banifits</a></td>
                                </tr>
                                 <tr>
                                    <td colspan="2">&nbsp;</td>
                                </tr>
                                <tr style="vertical-align:top;">
                                    <td colspan="2" style="vertical-align:top;"><input type="button" value="Save change now" id="save-e" /></td>
                                </tr>
                                
                            </tbody>
                         </table>
                          </div>
                        <!--End account Info-->
                        <!--end start 3-->
                        <input type="hidden" id="uid" name="<?php echo $item->uid;?>" />
                        <input type="hidden" id="hemail" name="<?php echo $item->email;?>" />
                        </form>
               <?php }?>
	</div>	
</div>
<?php } else{ // not allowed job posting
		echo JText::_('EA_YOU_ARE_NOT_ALLOWED_TO_VIEW');
	}
}//ol
?>
<div id="popupContainer" class="hidden" style="text-align:left;">
     fdfddfd
</div>
<div id="overlayEffect">
</div>
<div width="100%">
<?php
if($this->config['fr_cr_txsh']) {
	echo
	'<table width="100%" style="table-layout:fixed;">
		<tr><td height="15"></td></tr>
		<tr><td style="vertical-align:top;" align="center">'.$this->config['fr_cr_txa'].$this->config['fr_cr_txb'].'</td></tr>
	</table>';
}
?>
</div>
